<?
layout("/inc/win_layout.html",{title:sysTitle}){}
    ?>

<div class="page-content">


		<table class="table table-hover table-striped table-bordered table-advanced tablesorter mbn">
			<thead>
				<tr>
					<th ><input type="checkbox"></th>
					<th >序号</th>
					<th >用户名</th>
					<th >充值金额</th>
					<th >充值时间</th>
					<th >状态</th>
					<th >备注</th>
					<th >操作人</th>
				</tr>
			</thead>
			<tbody id="findUser">
			
			</tbody>
		</table>
		<div id="page2" style="text-align: center; margin-top: 20px;"></div>
	</div>
<script type="text/javascript">
	var id = window.parent.getUserNmaeId();
	
	$(function()  {
		queryUser(1);
	});
	
	function queryUser(curr){
		$.ajax({
			type : "post",
			url : "queryhistory.do",
			dataType : "json",
			data :{
				"id" : id,
				page : curr || 1,
				//queryParams:$("#queryParams").val(),
        	//	text:$("#text").val()
			},
			beforeSend : function(XMLHttpRequest) {
			},
			success : function(res){
				var str = "";
				$("#findUser").html("");

				for ( var i = 0; i < res[0].payRecharge.length; i++) {
					var status='';
					if(res[0].payRecharge[i].status == '0'){
						status='充值成功'
					}else{
						status='充值失败'
					}
					var users=''
					for ( var j = 0; j < res[0].user.length; j++) {
						if(res[0].user[j].id == res[0].payRecharge[i].createUserId){
							users = res[0].user[j].nickname;
						}
					}
					str += "<tr><td>"
           		 			+"<input type='checkbox' name='checkall' value='"+res[0].payRecharge[i].id+"'/>"
					 		+"</td><td>" 
							+(i + 1)
							+ "</td><td> <label id=>"
							+ res[0].payRecharge[i].memberUsername
							+ "</label></td><td><label >"
							+ res[0].payRecharge[i].payMoney
							+ "</label></td><td><label >"
							+ res[0].payRecharge[i].payTime
							+ "</label></td><td><label >"
							+ status
							+ "</label></td><td><label >"
							+ res[0].payRecharge[i].payRemark
							+ "</label></td><td><label >"
							+ users
							+ "</label></td>"
							+ "</tr>";
				}
				$("#findUser").append(str);
					laypage({
					cont : document.getElementById('page2'), //容器。值支持id名、原生dom对象，jquery对象,
					pages : res[0].count, //总页数
					skip : true, //是否开启跳页
					skin : 'molv', //加载内置皮肤，也可以直接赋值16进制颜色值，如:#c00
					curr: curr || 1,
					last: res[0].count,
					groups : 6,//连续显示分页数
					jump : function(obj, first) { //触发分页后的回调
						if (!first) { //点击跳页触发函数自身，并传递当前页：obj.curr
							queryUser(obj.curr);
							 curr = obj.curr;
						}
					}
				});
			}
		});
	
	}


</script>
